// eslint-disable-next-line
import {
  UserLayout,
  BasicLayout,
  BlankLayout
} from '@/layouts'
// import { bxAnaalyse } from '@/core/icons'

const RouteView = {
  name: 'RouteView',
  render: h => h('router-view')
}
console.log(window.menu)
export const asyncRouterMap = [{
    //path: '/',
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: {
      title: 'menu.home'
    },
    redirect: '/user/login',
    children: [
      // dashboard
      {
        path: '/home',
        name: 'home',
        redirect: '/home/index',
        component: RouteView,
        // hideChildrenInMenu: true,
        meta: {
          title: '首页',
          keepAlive: true,
          icon: 'line-chart',
          permission: ['home']
        },
        children: [{
            path: '/home/index',
            name: 'home-index',
            component: () => import('@/views/dashboard/home'),
            meta: {
              title: '首页',
              keepAlive: false,
              permission: ['home']
            },
          },
          // {
          //   path: '/home/index1',
          //   name: 'home-index1',
          //   component: () => import('@/views/dashboard/home'),
          //   meta: { title: '首页1', keepAlive: false, permission: ['home'] }
          // },
        ]
      },
      // 重做后添加  路由待改
      // 重做后添加  路由待改
      // 重做后添加  路由待改
      {
        path: '/clound',
        name: 'clound',
        component: RouteView,
        // hideChildrenInMenu:true,
        redirect: '/clound/send',
        meta: {
          title: '云短信',
          icon: 'cloud',
          permission: ['clound']
        },
        children: [
            // {
            // path: '/clound',
            // name: 'clound-inland',
            // component: () => import('@/views/cloud/Index'),
            // meta: {
            //   title: '国内短信',
            //   icon: 'global',
            //   keepAlive: true,
            //   permission: ['clound']
            // },
            // children: [
            {
                path: '/clound/send',
                name: 'clound-inland-send',
                component: () => import('@/views/cloud/Send'),
                meta: {
                  title: '短信发送',
                  icon: 'message',
                  keepAlive: true,
                  permission: ['clound']
                }
              },
              {
                path: '/clound/timing',
                name: 'clound-inland-timing',
                component: () => import('@/views/cloud/ListByTiming'),
                meta: {
                  title: '定时短信记录',
                  icon: 'clock-circle',
                  keepAlive: true,
                  permission: ['clound']
                }
              },
              {
                path: '/clound/log',
                name: 'clound-inland-log',
                component: () => import('@/views/cloud/List'),
                meta: {
                  title: '发送记录',
                  icon: 'ordered-list',
                  keepAlive: true,
                  permission: ['clound']
                }
              },
              {
                path: '/clound/signature',
                name: 'clound-inland-signature',
                redirect: '/signature/list/',
                hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
                component: () => import('@/views/cloud/Signature/Index'),
                meta: {
                  title: '签名列表',
                  icon: 'edit',
                  keepAlive: true,
                  permission: ['clound']
                },
                children: [{
                    path: '/signature/list/:pageNo([1-9]\\d*)?',
                    name: 'inland-signature-list',
                    component: () => import('@/views/cloud/Signature/List'),
                    meta: {
                      title: '列表',
                      keepAlive: true,
                      permission: ['cloud']
                    },
                  },
                  {
                    path: '/signature/add',
                    name: 'inland-signature-add',
                    component: () => import('@/views/cloud/Signature/Form'),
                    meta: {
                      title: '新增',
                      keepAlive: true,
                      permission: ['cloud']
                    },
                  },
                  {
                    path: '/signature/update/:id([1-9]\\d*)?',
                    name: 'inland-signature-update',
                    component: () => import('@/views/cloud/Signature/Form'),
                    meta: {
                      title: '编辑',
                      keepAlive: true,
                      permission: ['cloud']
                    },
                  }
                ]
              },
              // {
              //   path: '/clound/template',
              //   name: 'clound-inland-template',
              //   component: () => import('@/views/cloud/Sms-template'),
              //   meta: { title: '模板列表', icon: 'copy', keepAlive: true, permission: ['clound'] }
              // },
              {
                path: '/platformTemplate',
                name: 'inland-platformTemplate',
                redirect: '/platformTemplate/list/',
                hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
                component: () => import('@/views/cloud/PlatformTemplate/Index'),
                meta: {
                  title: '模板管理',
                  keepAlive: true,
                  permission: ['cloud'],
                  icon: 'copy'
                },
                children: [{
                    path: '/platformTemplate/list/:pageNo([1-9]\\d*)?',
                    name: 'inland-platformTemplate-list',
                    component: () => import('@/views/cloud/PlatformTemplate/List'),
                    meta: {
                      title: '列表',
                      keepAlive: true,
                      permission: ['cloud']
                    },
                  },
                  {
                    path: '/platformTemplate/add',
                    name: 'inland-platformTemplate-add',
                    component: () => import('@/views/cloud/PlatformTemplate/Form'),
                    meta: {
                      title: '新增',
                      keepAlive: true,
                      permission: ['cloud']
                    },
                  },
                  {
                    path: '/platformTemplate/update/:id([1-9]\\d*)?',
                    name: 'inland-platformTemplate-update',
                    component: () => import('@/views/cloud/PlatformTemplate/Form'),
                    meta: {
                      title: '编辑',
                      keepAlive: true,
                      permission: ['cloud']
                    },
                  }
                ]
              },
          //   ]
          // },
          // {
          //   path: '/clound/international',
          //   name: 'clound-international',
          //   component: () => import('@/views/cloud/Index'),
          //   redirect: '/clound/international/send',
          //   meta: {
          //     title: '国际短信',
          //     icon: 'global',
          //     keepAlive: true,
          //     permission: ['clound']
          //   },
          //   children: [{
          //       path: '/clound/international/send',
          //       name: 'clound-international-send',
          //       component: () => import('@/views/cloud/Send'),
          //       meta: {
          //         title: '短信发送',
          //         icon: 'message',
          //         keepAlive: true,
          //         permission: ['clound']
          //       }
          //     },
          //     {
          //       path: '/clound/international/timing',
          //       name: 'clound-international-timing',
          //       component: () => import('@/views/cloud/List'),
          //       meta: {
          //         title: '定时短信',
          //         icon: 'clock-circle',
          //         keepAlive: true,
          //         permission: ['clound']
          //       }
          //     },
          //     {
          //       path: '/clound/international/log',
          //       name: 'clound-international-log',
          //       component: () => import('@/views/cloud/List'),
          //       meta: {
          //         title: '发送记录',
          //         icon: 'ordered-list',
          //         keepAlive: true,
          //         permission: ['clound']
          //       }
          //     },
          //     {
          //       path: '/clound/international/signature',
          //       name: 'clound-international-signature',
          //       redirect: '/international/signature/list/',
          //       hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
          //       component: () => import('@/views/cloud/Signature/Index'),
          //       meta: {
          //         title: '签名列表',
          //         icon: 'edit',
          //         keepAlive: true,
          //         permission: ['clound']
          //       },
          //       children: [{
          //           path: '/international/signature/list/:pageNo([1-9]\\d*)?',
          //           name: 'international-signature-list',
          //           component: () => import('@/views/cloud/Signature/List'),
          //           meta: {
          //             title: '列表',
          //             keepAlive: true,
          //             permission: ['cloud']
          //           },
          //         },
          //         {
          //           path: '/international/signature/add',
          //           name: 'international-signature-add',
          //           component: () => import('@/views/cloud/Signature/Form'),
          //           meta: {
          //             title: '新增',
          //             keepAlive: true,
          //             permission: ['cloud']
          //           },
          //         },
          //         {
          //           path: '/international/signature/update/:id([1-9]\\d*)?',
          //           name: 'international-signature-update',
          //           component: () => import('@/views/cloud/Signature/Form'),
          //           meta: {
          //             title: '编辑',
          //             keepAlive: true,
          //             permission: ['cloud']
          //           },
          //         }
          //       ]
          //     },
          //     // {
          //     //   path: '/clound/international/template',
          //     //   name: 'clound-international-template',
          //     //   component: () => import('@/views/recharge/list'),
          //     //   meta: { title: '模板列表', keepAlive: true, permission: ['clound'] }
          //     // },
          //     {
          //       path: '/international/platformTemplate',
          //       name: 'international-platformTemplate',
          //       redirect: '/international/platformTemplate/list',
          //       hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
          //       component: () => import('@/views/cloud/PlatformTemplate/Index'),
          //       meta: {
          //         title: '模板管理',
          //         keepAlive: true,
          //         permission: ['cloud'],
          //         icon: 'copy'
          //       },
          //       children: [{
          //           path: '/international/platformTemplate/list/:pageNo([1-9]\\d*)?',
          //           name: 'international-platformTemplate-list',
          //           component: () => import('@/views/cloud/PlatformTemplate/List'),
          //           meta: {
          //             title: '列表',
          //             keepAlive: true,
          //             permission: ['cloud']
          //           },
          //         },
          //         {
          //           path: '/international/platformTemplate/add',
          //           name: 'international-platformTemplate-add',
          //           component: () => import('@/views/cloud/PlatformTemplate/Form'),
          //           meta: {
          //             title: '新增',
          //             keepAlive: true,
          //             permission: ['cloud']
          //           },
          //         },
          //         {
          //           path: '/international/platformTemplate/update/:id([1-9]\\d*)?',
          //           name: 'international-platformTemplate-update',
          //           component: () => import('@/views/cloud/PlatformTemplate/Form'),
          //           meta: {
          //             title: '编辑',
          //             keepAlive: true,
          //             permission: ['cloud']
          //           },
          //         }
          //       ]
          //     },
          //   ]
          // },
        ]
      },
      {
        path: '/finance',
        name: 'finance',
        component: RouteView,
        // hideChildrenInMenu:true,
        redirect: '/finance/expense',
        meta: {
          title: '财务',
          icon: 'wallet',
          permission: ['finance']
        },
        children: [{
            path: '/finance/expense',
            name: 'finance-expense',
            component: () => import('@/views/finance/expense'),
            meta: {
              title: '消费明细',
              icon: 'shopping',
              keepAlive: true,
              permission: ['finance']
            },
          },
          {
            path: '/finance/recharge',
            name: 'finance-recharge',
            component: () => import('@/views/finance/recharge'),
            meta: {
              title: '充值记录',
              icon: 'import',
              keepAlive: true,
              permission: ['finance']
            },
          },
        ]
      },
      {
        path: '/',
        name: 'setting',
        component: RouteView,
        // hideChildrenInMenu:true,
        redirect: '/setting/index',
        meta: {
          title: '设置',
          icon: 'setting',
          permission: ['setting']
        },
        children: [{
            path: '/setting/index',
            name: 'setting-index',
            redirect: '/setting/index/security',
            component: () => import('@/views/account/settings/Index'),
            meta: {
              title: '个人中心',
              icon: 'shopping',
              keepAlive: true,
              permission: ['setting']
            },
            hideChildrenInMenu: true,
            children: [
              // {
              //   path: '/setting/index/basic',
              //   name: 'BasicSettings',
              //   component: () => import('@/views/account/settings/BasicSetting'),
              //   meta: { title: 'account.settings.menuMap.basic', hidden: true, permission: ['user'] }
              // },
              {
                path: '/setting/index/security',
                name: 'SecuritySettings',
                component: () => import('@/views/account/settings/Security'),
                meta: {
                  title: 'account.settings.menuMap.security',
                  hidden: true,
                  keepAlive: true,
                  permission: ['user']
                }
              },
            ]
          },
          {
            path: '/setting/loginlog',
            name: 'setting-loginlog',
            component: () => import('@/views/account/UserLogList'),
            meta: {
              title: '登录记录',
              icon: 'shopping',
              keepAlive: true,
              permission: ['setting']
            },
          },
          {
            path: '/setting/setApi',
            name: 'setting-api',
            component: () => import('@/views/account/API'),
            meta: {
              title: 'API设置',
              icon: 'pull-request',
              keepAlive: true,
              permission: ['setting']
            },
          },
        ]
      },

      // 重做后添加  路由待改
      // 重做后添加  路由待改
      // 重做后添加  路由待改


      // Exception
      {
        path: '/exception',
        name: 'exception',
        component: RouteView,
        hidden: true,
        redirect: '/exception/403',
        meta: {
          title: 'menu.exception',
          icon: 'warning',
          permission: ['exception']
        },
        children: [{
            path: '/exception/403',
            name: 'Exception403',
            component: () => import( /* webpackChunkName: "fail" */ '@/views/exception/403'),
            meta: {
              title: 'menu.exception.not-permission',
              permission: ['exception']
            }
          },
          {
            path: '/exception/404',
            name: 'Exception404',
            component: () => import( /* webpackChunkName: "fail" */ '@/views/exception/404'),
            meta: {
              title: 'menu.exception.not-find',
              permission: ['exception']
            }
          },
          {
            path: '/exception/500',
            name: 'Exception500',
            component: () => import( /* webpackChunkName: "fail" */ '@/views/exception/500'),
            meta: {
              title: 'menu.exception.server-error',
              permission: ['exception']
            }
          }
        ]
      },

    ]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]

export const accountMap = [{
  path: '/',
  name: 'index',
  component: BasicLayout,
  
  meta: {
    title: 'menu.home'
  },
  redirect: '/dashboard/workplace',
  children: [{
      path: '/account',
      component: RouteView,
      redirect: '/account/center',
      name: 'account',
      hidden: true,
      meta: {
        title: 'menu.account',
        icon: 'user',
        keepAlive: true,
        permission: ['user']
      },
      children: [
        {
          path: '/account/center',
          name: 'center',
          component: () => import('@/views/account/center'),
          meta: { title: 'menu.account.center', keepAlive: true, permission: ['user'] }
        },
      ]
    },

    // 

  ]
}, ]
/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [{
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [{
        path: 'login',
        name: 'login',
        meta: {
          title: '登录',
          keepAlive: false,
          permission: ['dashboard']
        },
        component: () => import( /* webpackChunkName: "user" */ '@/views/user/Login')
      },
      {
        path: 'register',
        name: 'register',
        meta: {
          title: '注册',
          keepAlive: false,
          permission: ['dashboard']
        },
        component: () => import( /* webpackChunkName: "user" */ '@/views/user/Register')
      },
      {
        path: 'forgetPassword',
        name: 'forgetPassword',
        meta: {
          title: '忘记密码',
          keepAlive: false,
          permission: ['dashboard']
        },
        component: () => import( /* webpackChunkName: "user" */ '@/views/user/ForgetPassword')
      },
      
      {
        path: 'register-result',
        name: 'registerResult',
        component: () => import( /* webpackChunkName: "user" */ '@/views/user/RegisterResult')
      },
      {
        path: 'recover',
        name: 'recover',
        component: undefined
      }
    ]
  },
  {
    path: '/agreement',
    name: 'agreement',
    component: () => import( /* webpackChunkName: "fail" */ '@/views/user/Agreement')
  },
  {
    path: '/404',
    component: () => import( /* webpackChunkName: "fail" */ '@/views/exception/404')
  }
]